<!DOCTYPE html>

<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width">
	<title>ShieldJS2 Source: shield.HtmlAction.js</title>

	<!--[if lt IE 9]>
	<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
	<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">

	<link type="text/css" rel="stylesheet" href="styles/site.Cerulean.css">

</head>

<body>

<div class="navbar navbar-default navbar-fixed-top navbar-inverse">
<div class="container">
	<div class="navbar-header">
		<a class="navbar-brand" href="index.html">ShieldJS2</a>
		<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
        </button>
	</div>
	<div class="navbar-collapse collapse" id="topNavigation">
		<ul class="nav navbar-nav">
			
			<li class="dropdown">
				<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a>
				<ul class="dropdown-menu ">
					<li><a href="ShieldJS.core._defaults.html">ShieldJS.core._defaults</a></li>
				</ul>
			</li>
			
			<li class="dropdown">
				<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
				<ul class="dropdown-menu ">
					<li><a href="$().contentChange.html">$().contentChange</a></li><li><a href="$().insertAtCursor.html">$().insertAtCursor</a></li><li><a href="$().resize.html">$().resize</a></li><li><a href="$().selection.html">$().selection</a></li><li><a href="$().serializeJson.html">$().serializeJson</a></li><li><a href="$().shieldBindHtmlAction.html">$().shieldBindHtmlAction</a></li><li><a href="$().shieldLeftMenu.html">$().shieldLeftMenu</a></li><li><a href="$().shieldMainContent.html">$().shieldMainContent</a></li><li><a href="Dialog.html">Dialog</a></li><li><a href="Map.html">Map</a></li><li><a href="ShieldJS.html">ShieldJS</a></li><li><a href="ShieldJS.ajax.html">ShieldJS.ajax</a></li><li><a href="ShieldJS.core.html">ShieldJS.core</a></li><li><a href="ShieldJS.dialog.html">ShieldJS.dialog</a></li><li><a href="ShieldJS.form.html">ShieldJS.form</a></li><li><a href="ShieldJS.HtmlAction.html">ShieldJS.HtmlAction</a></li><li><a href="ShieldJS.HtmlAction.HTMLEleActions.html">ShieldJS.HtmlAction.HTMLEleActions</a></li><li><a href="ShieldJS.HtmlAction.successDo.html">ShieldJS.HtmlAction.successDo</a></li><li><a href="ShieldJS.HtmlAction.successDoMethod.html">ShieldJS.HtmlAction.successDoMethod</a></li><li><a href="String.replaceAll.html">String.replaceAll</a></li>
				</ul>
			</li>
			
			<li class="dropdown">
				<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
				<ul class="dropdown-menu ">
					<li><a href="global.html#dateFormat">dateFormat</a></li><li><a href="global.html#ele">ele</a></li><li><a href="global.html#findAndMarkEle">findAndMarkEle</a></li><li><a href="global.html#findAndMarkEleOn">findAndMarkEleOn</a></li><li><a href="global.html#findEle">findEle</a></li><li><a href="global.html#formatUrl">formatUrl</a></li><li><a href="global.html#getExtendSettings">getExtendSettings</a></li><li><a href="global.html#getjQueryObj">getjQueryObj</a></li><li><a href="global.html#getJSDir">getJSDir</a></li><li><a href="global.html#getJSPath">getJSPath</a></li><li><a href="global.html#getParams">getParams</a></li><li><a href="global.html#getRandomColor">getRandomColor</a></li><li><a href="global.html#getSettings">getSettings</a></li><li><a href="global.html#getTimeAttr">getTimeAttr</a></li><li><a href="global.html#hasAttr">hasAttr</a></li><li><a href="global.html#height">height</a></li><li><a href="global.html#index">index</a></li><li><a href="global.html#jQObjEmpty2Null">jQObjEmpty2Null</a></li><li><a href="global.html#openNewPage">openNewPage</a></li><li><a href="global.html#paramNameAdapt">paramNameAdapt</a></li><li><a href="global.html#preEle">preEle</a></li><li><a href="global.html#preEleIndex">preEleIndex</a></li><li><a href="global.html#printCallStack">printCallStack</a></li><li><a href="global.html#removeHtml">removeHtml</a></li><li><a href="global.html#replaceParamVal">replaceParamVal</a></li><li><a href="global.html#title">title</a></li><li><a href="global.html#width">width</a></li>
				</ul>
			</li>
			
		</ul>
        
            <div class="col-sm-3 col-md-3">
                <form class="navbar-form" role="search">
                    <div class="input-group">
                        <input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
                        <div class="input-group-btn">
                            <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
                        </div>
                    </div>
                </form>
            </div>
        
	</div>

</div>
</div>


<div class="container" id="toc-content">
<div class="row">

	
	<div class="col-md-12">
	
		<div id="main">
			

		<h1 class="page-title">Source: shield.HtmlAction.js</h1>
    
<section>
    <article>
        <pre
            class="sunlight-highlight-javascript linenums">//html标签的js动作处理
(function($){
	ShieldJS.HtmlAction = {
		/**	处理成功后的回调方法名
		 * @class ShieldJS.HtmlAction.successDo */
		successDo : {
			/**	刷新，关闭dialog，并刷新搜索表单(默认)
			 * @type String */
			shieldRefresh: "shieldRefresh",
			/**	什么都不做
			 * @type String */
			shieldDonothing: "shieldDonothing",
			/**	只刷新搜索表单
			 * @type String */
			shieldReSearch: "shieldReSearch",
			/**	只关闭dialog
			 * @type String */
			shieldDialogRemove: "shieldDialogRemove",
			/**	刷新Tab（有dialog也会关闭）,用于多页签内容页的刷新
			 * @type String */
			shieldRefreshTab: "shieldRefreshTab",
			/**	刷新Tab（不关闭dialog）,用于多页签内容页的刷新
			 * @type String */
			shieldRefreshTabIgnoreDialog: "shieldRefreshTabIgnoreDialog",
			/**	自定义方法
			 * @type String */
			shieldExtend: "shieldExtend" //
		},
		names : {
			shieldSelectRow : "shieldSelectRow",
			shieldSelectRowByshieldCheck : "shieldSelectRowByshieldCheck"
		},
		/**	处理成功后的回调执行方法
		 * @class ShieldJS.HtmlAction.successDoMethod */
		successDoMethod : {
			shieldRefresh : function(contentE, searchForm, menuliSelect, dialog, oldRefresh){ //刷新，关闭dialog，并刷新搜索表单(默认)
				if (dialog) {
					dialog.remove();
				}
				if (searchForm) {
					if (!oldRefresh) { //兼容旧框架的json返回，不重复刷新
						searchForm.submit();
					}
				} else if (menuliSelect) {
					menuliSelect.click();
				}
			},
			shieldDonothing : function(contentE, searchForm, menuliSelect, dialog, oldRefresh) { //什么都不做
			},
			shieldReSearch : function(contentE, searchForm, menuliSelect, dialog, oldRefresh) { //只刷新搜索表单
				if (searchForm) {
					if (!oldRefresh) { //兼容旧框架的json返回，不重复刷新
						searchForm.submit();
					}
				} else if (menuliSelect) {
					menuliSelect.click();
				}
			},
			shieldDialogRemove : function(contentE, searchForm, menuliSelect, dialog, oldRefresh) { //只关闭dialog
				if (dialog) {
					dialog.remove();
				}
			},
			shieldRefreshTabDealFn : function(contentE, searchForm, menuliSelect, dialog, closeDialog) { //刷新Tab处理函数，内部使用
				var shieldHeader = contentE.find(".shieldHeader");
				if (shieldHeader.length > 0) {
					if (closeDialog &amp;&amp; dialog) {
						dialog.remove();
					}
					var headerCurClasses = ShieldJS.core.options.headerCurClass.replace(" ",".");
					var shieldJuniorSelectE = contentE.find(".shieldJunior."+headerCurClasses);
					if(shieldJuniorSelectE.length > 0){
						shieldJuniorSelectE.click();
					} else {
						var shieldHeaderSelectE = shieldHeader.find("."+headerCurClasses);
						if(shieldHeaderSelectE.length > 0){
							shieldHeaderSelectE.click();
						}
					}
				}
			},
			shieldRefreshTab : function(contentE, searchForm, menuliSelect, dialog, oldRefresh) { //刷新Tab,用于多页签内容页的刷新
				ShieldJS.HtmlAction.successDoMethod.shieldRefreshTabDealFn(contentE, searchForm, menuliSelect, dialog, true)
			},
			shieldRefreshTabIgnoreDialog : function(contentE, searchForm, menuliSelect, dialog, oldRefresh) { //刷新Tab（不关闭，dialog）,用于多页签内容页的刷新
				ShieldJS.HtmlAction.successDoMethod.shieldRefreshTabDealFn(contentE, searchForm, menuliSelect, dialog, false)
			},
			shieldExtend : function(contentE, searchForm, menuliSelect, dialog, oldRefresh, result) { //自定义

			}
		},
		/**	检查成功的回调函数是否存在
		 * @param successDoName {String} 成功后的回调方法名
		 * @returns  {Boolean} 方法存在时返回true，否则返回false */
		checkSuccessDoMethodExist : function (successDoName) {
			if(!$.isFunction(ShieldJS.HtmlAction.successDoMethod[successDoName])){
				var suddceeDoExtendFn = eval(successDoName); //自定义的回调方法
				if(!$.isFunction(suddceeDoExtendFn)){
					ShieldJS.error(successDo + "成功后的回调处理函数不存在！");
					return false;
				}
			}
			return true;
		},
		/**	指定成功的回调函数,result为成功返回的结果
		 * @param successDoName {String} 成功后的回调方法名 */
		execSuccessDoMethod : function (successDoName, contentE, searchForm, menuliSelect, dialog, oldRefresh, result) {
			if($.isFunction(ShieldJS.HtmlAction.successDoMethod[successDoName])){ //预定于的回调方法
				ShieldJS.HtmlAction.successDoMethod[successDoName](contentE, searchForm, menuliSelect, dialog, oldRefresh, result);
			} else {
				var suddceeDoExtendFn = eval(successDoName); //自定义的回调方法
				if($.isFunction(suddceeDoExtendFn)){
					suddceeDoExtendFn(contentE, searchForm, menuliSelect, dialog, oldRefresh, result);
				}
			}
		},
		//post提交数据
		postData : function(url, params, contentE, searchForm, menuliSelect, shieldDialog, successDo, methodType, successCallback) {
			var method = "post";
			if ($.isFunction(methodType)) { //是函数，则为successCallback
				successCallback = methodType;
			}else {
				method = methodType;
			}
			if (method == "get") {
				ShieldJS.ajax.get(null, url, params, function(json) {
            		ShieldJS.HtmlAction.execSuccessDoMethod(successDo, contentE, searchForm, menuliSelect, shieldDialog, json.refresh, json);
            		if (successCallback) {
            			successCallback();
                    }
            	}, function(json) {
            		ShieldJS.debug("提交数据出错！" + url + " params: " + $.param(params));
            	});
            } else {
            	ShieldJS.ajax.post(url, params, function(json) {
            		ShieldJS.HtmlAction.execSuccessDoMethod(successDo, contentE, searchForm, menuliSelect, shieldDialog, json.refresh, json);
            		if (successCallback) {
            			successCallback();
                    }
            	}, function(json) {
            		ShieldJS.debug("提交数据出错！" + url + " params: " + $.param(params));
            	}, "json");
			}
			
		},
		//检查并返回参数,如果正常返回params否则返回false
		checkAnGetParamSelector : function(ele, params, contentEle){
			if (!contentEle) {
				contentEle = ShieldJS.contentMainE; //主内容区没有包含弹出框
				if (ShieldJS.dialogE) { //增加弹出框对象 ，注意此处未做回归测试，可能有问题
					contentEle = contentEle.add(ShieldJS.dialogE);
                }
            }
			if (hasAttr(ele, "paramSelector")) { //参数选择器
				var bodyE = $("body");
				var paramSelector = ele.attr("paramSelector");
				/*{selectRows}表示复选框选中行的数据作为参数提交，如果只想选一部分可以在里面增加选择器
				 {selectRows>:checkbox}意思为只提交选中行的的checkbox作为参数,用'>'连接选择器，里面的选择器为jQuery选择器*/
				if (paramSelector.indexOf("{selectRows") != -1 ) { //选中行用>分隔内部选择器
					// 括号表示组。访问可以用group[index]来访问每组的信息  
					var linkRegx = /.*{(selectRows.*?)},?/;  
					var group = paramSelector.match(linkRegx);
					if (group.length == 2) { //如果包含则为长度为2
						var selectRows = group[1]; //selectRows
						var selectRowsEle = contentEle.find("."+ShieldJS.HtmlAction.names.shieldSelectRowByshieldCheck);
						if(selectRows.indexOf(">") > 0){ //过滤
							var selectRowsArrs = selectRows.split(">");
							selectRowsEle = contentEle.find("."+ShieldJS.HtmlAction.names.shieldSelectRowByshieldCheck).filter(selectRowsArrs[1]);
						}
						if (!selectRowsEle.is(":input")) { //如果不是input，继续查找内部的input
							selectRowsEle = selectRowsEle.find(":input");
						}
						if (ShieldJS.form.validate(selectRowsEle)) {
							params = $.extend(true, {}, params, selectRowsEle.serializeJson());
							if ($.isEmptyObject(params)) {
								ShieldJS.alert("消息提示", "至少选中一条信息！", "error");
								return false;
							}
                        } else {
                        	ShieldJS.debug("参数选择器验证未通过！");
                        	return false;
						}
					} else {
						ShieldJS.error("参数选择器参数设置错误，请检查{selectRows}！");
						return false;
					}
					paramSelector = paramSelector.replace(linkRegx, "");
				} 
				if (paramSelector.indexOf("{currRows") != -1 ) {//当前行用>分隔内部选择器
					// 括号表示组。访问可以用group[index]来访问每组的信息  
					var linkRegx = /.*{(currRows.*?)},?/;  
					var group = paramSelector.match(linkRegx);
					if (group.length == 2) { //如果包含则为长度为2
						var selectRows = group[1]; //selectRows
						var selectRowsEle = ele.closest("tr");
						if(selectRows.indexOf(">") > 0 ){ //过滤
							var selectRowsArrs = selectRows.split(">");
							selectRowsEle = cselectRowsEle.filter(selectRowsArrs[1]);
						}
						if (!selectRowsEle.is(":input")) { //如果不是input，继续查找内部的input
							selectRowsEle = selectRowsEle.find(":input");
						}
						if (ShieldJS.form.validate(selectRowsEle)) {
							params = $.extend(true, {}, params, selectRowsEle.serializeJson());
                        } else {
                        	ShieldJS.debug("参数选择器验证未通过！");
                        	return false;
						}
					} else {
						ShieldJS.error("参数选择器参数设置错误，请检查{currRows}！");
						return false;
					}
					paramSelector = paramSelector.replace(linkRegx, "");
				} 
				if (paramSelector) { //继续检查
					var selectEles = contentEle.find(paramSelector);
					if (ShieldJS.form.validate(selectEles)) {
						params = $.extend(true, {}, params, selectEles.serializeJson());
						if ($.isEmptyObject(params)) {
							ShieldJS.alert("消息提示", "参数为空，请返回检查！", "error");
							return false;
						}
					} else {
						ShieldJS.debug("参数选择器验证未通过！");
						return false;
					}
                }
			}
			return params;
		},
		// 检查自定义点击回调方法是否存在
		hasClickCallbackFn : function(ele, eventName) {
			var $events = $._data(ele[0], "events");
			if( $events &amp;&amp; $events[eventName] ){
				return true;
			}
			return false;
		},
		// 自定义点击回调
		clickCallback : function(ele) {
			var eventName = "clickCallback";
			if (ShieldJS.HtmlAction.hasClickCallbackFn(ele, eventName)) {
				var $events = $._data(ele[0],"events");
				if( $events &amp;&amp; $events[eventName] ){
					ele.trigger(eventName);
				}
            }
		},
		/**	表单提交成功后的回调方法
		 * @param successDo    {String} 成功后的回调方法名
		 * @param formE        {jQuery} 表单对象
		 * @param targetE      {jQuery} 表单提交的目标对象
		 * @param data         {Object} 返回结果的对象可能为json也可能为页面字符
		 * @param menuliSelect {jQuery} 左侧栏menu 
		 * @param navMenuSelect{jQuery} 导航栏menu 
		 * @param searchForm   {jQuery} 搜索表单  
		 * @param dialog       {ShieldJS.dialog} 弹出框对象
		 *  */
		formSubmitCallback : function(successDo, formE, targetE, data, menuliSelect, navMenuSelect, searchForm, dialog ) {
			var successDoForm = successDo;
			if (hasAttr(formE, "successDo")) { //form上保存成功后的处理
				successDoForm = formE.attr("successDo");
			}
			if (successDoForm) { //回调
				if (!ShieldJS.HtmlAction.checkSuccessDoMethodExist(successDoForm)) {
					return false;
				} else {
					// 为json格式
					var json;
					if (typeof data == 'object') {
						json = data;
					} else {
						try {
							json = $.parseJSON(data);
						} catch (e) {
							json = '';
						}
					}
					ShieldJS.HtmlAction.execSuccessDoMethod(successDoForm, ShieldJS.contentMainE, searchForm, menuliSelect, dialog, json.refresh, json);
				}
			}
			if (targetE &amp;&amp; targetE.is(":visible")) { //未关闭
				ShieldJS.core.bindHtmlAction(targetE, menuliSelect, navMenuSelect, searchForm, dialog); //内部继续加载,已经默认实现
            }  
        },
		/**	html元素的扩展动作方法
		 * @class ShieldJS.HtmlAction.HTMLEleActions
		 *  */
		HTMLEleActions : {
			/**	弹出窗口，添加，显示，修改等；查找带回 */
			shieldDialogOrLookup: {
				expression : '.shieldDialog,.shieldLookup',
				/* selectE：选中的元素dom menuliSelect：左侧栏menu navMenuSelect：导航栏menu searchForm：搜索表单  shieldDialog：弹出框 */
				fn : function(selectE, menuliSelect, navMenuSelect, searchForm, shieldDialog){
					//存在checkFn时contentE为checkFn函数的返回值
					selectE.unbind("click").click(function() {
						var $this = $(this);
						if(hasAttr($this,"confirm")){ //确认信息
							var confirmMsg = $this.attr("confirm"); 
							if(!confirm(confirmMsg)){
								return false;
							}
						}
						var relType; //iframe
						if($this.data("relType")){ //打开类型,data-rel-type
							relType = $this.data("relType");
						}
						var viewTitle = "信息";
						if(hasAttr($this,ShieldJS.css.TITLE)){
							viewTitle = $this.attr(ShieldJS.css.TITLE);
						}
						var viewWidth = 500;
						if(hasAttr($this,ShieldJS.css.WIDTH)){
							viewWidth = $this.attr(ShieldJS.css.WIDTH);
						}
						var viewHeight = 600; //iframe打开时用到
						if(hasAttr($this,ShieldJS.css.HEIGHT)){
							viewHeight = $this.attr(ShieldJS.css.HEIGHT);
						}
						var url = $this.data("url");
						var params = {};
						var checkParams = ShieldJS.HtmlAction.checkAnGetParamSelector($this, params); //参数选择器
						if (!checkParams) {
							return false;
						} else {
							params = checkParams;
						}
						params = getParams($this,params);
						var successDo = ShieldJS.HtmlAction.successDo.shieldRefresh;
						if (hasAttr($this, "successDo")) { //保存成功后的处理
							successDo = $this.attr("successDo");
						}
						ShieldJS.openDialog(url, params, function(ele, dialog) {
							ShieldJS.form.initSubmit(ele, function(formE, targetE, data) {//成功后
								ShieldJS.HtmlAction.formSubmitCallback(successDo, formE, targetE, data,menuliSelect, navMenuSelect, searchForm, dialog);
							});
							 //默认输入光标在第一个输入框内
							var eleInput =  findAndMarkEle(ele, 'input[type="text"],textarea');
							var inputLength = eleInput.length;
							if(inputLength>0)
							{
							    eleInput.eq(0).focus();
							}
						
							 //查找带回
							if($this.hasClass("shieldLookup")){
								var selectBtnEles = findAndMarkEle(ele, ".selectBtn"); //选择按钮
								var formE = $this.closest("form");
								selectBtnEles.click(function(){
									var selectBtnEle = $(this);
									var thisIndex = formE.find(".shieldLookup").index($this);
									formE.find(':input.shieldLookupId').eq(thisIndex).val(selectBtnEle.data("id")).triggerHandler("change");//触发自定义change事件
									var shieldLookupShowNameEle = formE.find('.shieldLookupName').eq(thisIndex);
									var isInput = shieldLookupShowNameEle.is(":input");
									if(isInput){
										shieldLookupShowNameEle.val(selectBtnEle.data("name"));
									}else{
										shieldLookupShowNameEle.text(selectBtnEle.data("name"));
									}
									shieldLookupShowNameEle.triggerHandler("change");//触发自定义change事件
									
									dialog.remove();
								});
							}
							
							//ShieldJS.core.bindHtmlAction(ele, menuliSelect, navMenuSelect, searchForm, dialog); //内部继续加载,已经默认实现
							
						}, viewTitle, viewWidth, viewHeight, null, relType);
						return false;
					});
				},
				checkFn : function(contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog){
					var dealEle = findAndMarkEle(contentE, this.expression);
					if (dealEle.length > 0) {
						dealEle.each(function(){
							var eleName = "shieldDialog元素";
							var $this = $(this);
							//查找带回
							if ($this.hasClass("shieldLookup")) {
								eleName = "shieldDialog元素";
								var formE = $this.closest("form");
								if (formE.length == 0) {
									ShieldJS.error(eleName + "元素需要包含在form内部！");
									return false;
								}
								var shieldLookupEles = formE.find(".shieldLookup");
								var shieldLookupShowIdEles = formE.find(':input.shieldLookupId');//触发自定义change事件
								var shieldLookupShowNameEles = formE.find('.shieldLookupName');
								
								if (shieldLookupEles.length != shieldLookupShowIdEles.length) {
									ShieldJS.error(eleName + "个数与shieldLookupId个数不相等，请检查！");
									return false;
								} if (shieldLookupEles.length != shieldLookupShowNameEles.length) {
									ShieldJS.error(eleName + "个数与shieldLookupName个数不相等，请检查！");
									return false;
								}
							}
							
							if(!$this.data("url")){ //有链接才处理
								dealEle = dealEle.not($this);
								ShieldJS.error(eleName + "缺少data-url属性");
								ShieldJS.console(eleName + "缺少data-url属性"+$this.prop("outerHTML"));
								return false;
							}
							
						});
					}
					return dealEle.length > 0 ? dealEle : false;
				}
				,description : "1、弹出窗口，添加，显示，修改等；2、查找带回"
			},
			/**	ajax请求,返回json格式，删除、更新状态等 */
			shieldAjax : {
				expression : '.shieldAjax'
				,deal : function(ele, contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog){
					var $this = ele;
					if($this.data("url")){ //有链接才处理
						var successDo = ShieldJS.HtmlAction.successDo.shieldRefresh;
						if (hasAttr($this,"successDo")) { //保存成功后的处理
							successDo = $this.attr("successDo");
						}
						if (successDo) { //回调
							if(!ShieldJS.HtmlAction.checkSuccessDoMethodExist(successDo)){
								return false;
							}
						}
						var url = $this.data("url");
						var viewTitle;
						if(hasAttr($this, ShieldJS.css.TITLE)){
							viewTitle = $this.attr(ShieldJS.css.TITLE);
						}
						var params={};
						var checkParams = ShieldJS.HtmlAction.checkAnGetParamSelector($this, params); //参数选择器
						if (!checkParams) {
							return false;
						} else {
							params = checkParams;
						}
						params = getParams($this, params);
						var runnext =true; //继续执行
						if(viewTitle){
							ShieldJS.confirm("确认提示", viewTitle, function() {
								ShieldJS.HtmlAction.postData(url, params, contentE, searchForm, menuliSelect, shieldDialog, successDo, ShieldJS.HtmlAction.clickCallback($this));
                            });
						} else {
							ShieldJS.HtmlAction.postData(url, params, contentE, searchForm, menuliSelect, shieldDialog, successDo, ShieldJS.HtmlAction.clickCallback($this));
						}
						return false;
					} else {
						ShieldJS.error("shieldAjax元素缺少data-url属性！");
						ShieldJS.console("shieldAjax元素缺少data-url属性！"+$this.prop("outerHTML"));
						return false;
					}
				}
				,fn : function(contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog){
					var dealMethod = this.deal;
					findAndMarkEle(contentE, this.expression).click(function() {
						var $this = $(this);
						dealMethod($this, contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog);
						return false;
					});
				}
				,description : "ajax请求,返回json格式，删除、更新状态等"
			},
			/**	ajax删除的处理 */
			shieldDelete : {
				expression : '.shieldDelete',
				fn : function(contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog){
					findAndMarkEle(contentE, this.expression).each(function() {
						var $this = $(this);
						if(!hasAttr($this, ShieldJS.css.TITLE)){
							$this.attr(ShieldJS.css.TITLE, "确定删除该信息吗？");
						}
						$this.click(function() {
							var $this = $(this);
							return ShieldJS.HtmlAction.HTMLEleActions.shieldAjax.deal($this, contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog);
						});
					});
				}
				,description : "ajax删除处理。"
			},
			/**	覆盖内容，类似于jQuery的jObj.load() */
			shieldLoad : {
				expression : '.shieldLoad',
				fn : function(selectE, menuliSelect, navMenuSelect, searchForm, shieldDialog){
					var loadContent = function(ele) {
						var $this = ele;
						var url = $this.data("url");
						var targetEle = getjQueryObj($this.data("target"));
						if (!targetEle) {
							targetEle = $this; //target如果没有则为自身
                        }
						var viewTitle;
						if(hasAttr($this,ShieldJS.css.TITLE)){
							viewTitle = $this.attr(ShieldJS.css.TITLE);
						}
						var params={};
						var checkParams = ShieldJS.HtmlAction.checkAnGetParamSelector($this, params); //参数选择器
						if (!checkParams) {
							return false;
						} else {
							params = checkParams;
						}
						params = getParams($this,params);
						// 执行方法
						var doing =  function() {
							targetEle.html(ShieldJS.loadingHtml);
							ShieldJS.ajax.post(url, params, function(data) {
								targetEle.html(data);
								ShieldJS.form.initSubmit(targetEle, function(formE, targetE, data){
									//改写form的submit方法（util.js）
								});
								//页面处理
								ShieldJS.core.bindHtmlAction(targetEle, menuliSelect, navMenuSelect, searchForm);
								// 自定义点击回调
								ShieldJS.HtmlAction.clickCallback($this);
							}, null, null, true);
						}
						if (viewTitle) {
							ShieldJS.confirm("确认提示", viewTitle, function() {
								doing();
                            });
						}else {
							doing();
						}
                    };
                    selectE.each(function() {
                    	var $this = $(this);
                    	var autoload = "false";
                    	if(hasAttr($this, "autoload")){ //autoLoad
                    		autoload = $this.attr("autoload")||"true";
                    	}else if(hasAttr($this, "autoLoad")){ //autoLoad
                    		autoload = $this.attr("autoLoad")||"true";
                    	}
                    	if (autoload=="true") { //自动加载
                    		loadContent($this);
                        }else { 
                        	$this.click(function() {
                        		loadContent($this);
//                        		return false;
                        	});
						}
                    });
				},
				checkFn : function(contentE, menuliSelect, navMenuSelect, searchForm){
					var dealEle = findAndMarkEle(contentE, this.expression);
					var eleName = "shieldLoad元素";
					if (dealEle.length > 0) {
						dealEle.each(function(i, n){
							var $this = $(this);
							if (!$this.data("url")) {
								ShieldJS.error(eleName + "未定义data-url：请添加该属性！");
								ShieldJS.console(eleName + "未定义data-url：请添加该属性！"+$this.prop("outerHTML"));
								return false;
							} else if (hasAttr($this,"data-target") &amp;&amp; contentE.find($this.data("target")).length == 0) {
								ShieldJS.error(eleName + "目标元素未找到：请检查 data-target 的定义是否正确！");
								return false;
							}
						});
					}
					return dealEle.length > 0 ? dealEle : false;
				}
				,description : "覆盖内容，类似于jQuery的jObj.load()"
			},
			/**	a标签附加参数(如果不是新打开的页面,为Get方式提交需要注意参数长度) */
			shieldA : {
				expression : '.shieldA',
				fn : function(contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog){
					findAndMarkEle(contentE, this.expression).each(function() {
						var $this = $(this);
						if($this.data("url")){ //有链接才处理
							$this.click(function() {
								var url = $this.data("url");
								var params={};
								var checkParams = ShieldJS.HtmlAction.checkAnGetParamSelector($this, params); //参数选择器
								if (!checkParams) {
									return true;
								} else {
									params = checkParams;
								}
								params = getParams($this, params);
								
								var method = $this.data("method")||"get";
								var target = $this.data("target")||"_blank";
								if (target == "_blank") {
									openNewPage($this, url, params); //shield.util.js 中的方法
									// 自定义点击回调
									ShieldJS.HtmlAction.clickCallback($this);
								} else {
									var targetE = getjQueryObj(target);
									if (method == "post") {
										ShieldJS.ajax.post(targetE, url, params,  function() {
											//内容区处理
											if(!ShieldJS.core.contentAreaDeal(targetE, null, null)){
//											return false;
											}
											// 自定义点击回调
											ShieldJS.HtmlAction.clickCallback($this);
										});
									} else {
										ShieldJS.ajax.get(targetE, url, params,  function() {
											//内容区处理
											if(!ShieldJS.core.contentAreaDeal(targetE, null, null)){
//                                			return false;
											}
											// 自定义点击回调
											ShieldJS.HtmlAction.clickCallback($this);
										});
									}
								}
//							return false;
							})
						}
                    });
				}
				,description : "a标签附加参数(如果不是新打开的页面,为Get方式提交需要注意参数长度)"
			},
			/**	打开链接 */
			shieldOpenLink : {
				expression : '.shieldOpenLink',
				fn : function(selectE, menuliSelect, navMenuSelect, searchForm, shieldDialog){
					 selectE.unbind("click").click(function() {
						 var $this = $(this);
						 var linkSrcE = $this;
						 var url = '';
						 if (hasAttr($this, "baseOn")) { //基于元素
							 var baseOnValue = $this.attr("baseOn");
							 var baseOnValueArrs = baseOnValue.split(">");
							 if (baseOnValueArrs.length == 2) {
								 linkSrcE = $this.closest(baseOnValueArrs[0]).find(baseOnValueArrs[1]);
								 if (linkSrcE.is(":input")) {
									 url = linkSrcE.val();
								 } else {
									 url = linkSrcE.text();
								 }
							 }
						 } else {
							 var prevE = $this.prev();
							 if (prevE.is(":input")) { // 类型为text的input或select  if (prevE.is(":text") || prevE.is("select")) {
								 url = prevE.val();
							 } else {
								 url = $this.text();
							 }
						 }
						 url = formatUrl(url);
						 if (url == '') {
							 ShieldJS.alert("消息提示", '空连接,不能打开!', "error");
						 } else {
							 $this.after("&lt;a href='" + url + "' target='_blank'>&lt;/a>");
							 var a = $this.next();
							 a[0].click(); //直接用a.click()不执行
							 a.remove();
							 // 自定义点击回调
							 ShieldJS.HtmlAction.clickCallback($this);
						 }
						return false;
					});
				},
				checkFn : function(contentE, menuliSelect, navMenuSelect, searchForm){
					var dealEle = findAndMarkEle(contentE, this.expression);
					var eleName = "shieldOpenLink元素";
					if (dealEle.length > 0) {
						dealEle.each(function(i, n){
							var $this = $(this);
							if (hasAttr($this, "baseOn")) { //基于元素
								 var baseOnValue = $this.attr("baseOn");
								 var baseOnValueArrs = baseOnValue.split(">");
								 if (baseOnValueArrs.length == 2) {
									 linkSrcE = $this.closest(baseOnValueArrs[0]).find(baseOnValueArrs[1]);
									 if(linkSrcE.length == 0){
										 ShieldJS.error(eleName + "未定义链接源元素：请检查baseOn的值定义是否正确（父元素选择器+“>”+源元素选择器）");
										 ShieldJS.console(eleName + "未定义链接源元素：请检查baseOn的值定义是否正确（父元素选择器+“>”+源元素选择器）"+baseOnValue+$this.prop("outerHTML"));
										 return false;
									 }
								 }
							 }
						});
					}
					return dealEle.length > 0 ? dealEle : false;
				}
				,description : "打开链接"
			},
			/** 刷新 */
			shieldRefresh : {
				expression : '.shieldRefresh',
				fn : function(contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog){
					 findAndMarkEle(contentE, this.expression).unbind("click").click(function() {
						ShieldJS.HtmlAction.successDoMethod.shieldRefresh(contentE, searchForm, menuliSelect, shieldDialog);
						// 自定义点击回调
						ShieldJS.HtmlAction.clickCallback($(this));
						return false;
					});
				}
			 	,description : "刷新"
			},
			/** 带参数提交（form基础上点击不同按钮提交不同结果） */
			shieldSubmit : {
				expression : '.shieldSubmit',
				fn : function(contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog){
					 findAndMarkEle(contentE, this.expression).unbind("click").click(function() {
						var $this = $(this);
						var params={};
						
						var checkParams = ShieldJS.HtmlAction.checkAnGetParamSelector($this, params); //参数选择器
						if (!checkParams) {
							return false;
						} else {
							params = checkParams;
						}
						
						params = getParams($this,params);
						var formE = $this.closest('form');
						if (formE.length > 0){
							for(var key in params){
								formE.find("input[name='"+key+"']").val(params[key]);
							}
							if (!shieldDialog) { //dialog不存在时才处理，存在时默认处理
								ShieldJS.form.initSubmit(contentE, function(formE, targetE, data){
									// 初始化页面内容
									ShieldJS.core.bindHtmlAction(contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog);
									// 自定义点击回调
									ShieldJS.HtmlAction.clickCallback($this);
								});
							}
							formE.submit();
						}
						return false;
					});
				}
				,description : "带参数提交（form基础上点击不同按钮提交不同结果）"
			},
			/** 回调 */
			shieldDialogCallback : {
				expression : '.shieldDialogCallback',
				fn : function(contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog){
					var shieldDialogCallbackEle = findAndMarkEle(contentE, this.expression);
					if (shieldDialogCallbackEle.length > 0) {
						var methodName = shieldDialogCallbackEle.attr("callback");
						ShieldJS.shieldDialogCallback[methodName](contentE, shieldDialog);
					}
				}
			 	,description : "回调"
			},
			/** 弹出新窗口操作 */
			shieldOpenWindow : {
				expression : 'a.shieldOpenWindow',
				fn : function(contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog){
					 findAndMarkEle(contentE, this.expression).unbind("click").click(function() {
						var $this = $(this);
						var viewTitle = "信息";
						if(hasAttr($this, ShieldJS.css.TITLE)){
							viewTitle = $this.attr(ShieldJS.css.TITLE);
						}
						var viewWidth = 500;
						if(hasAttr($this, ShieldJS.css.WIDTH)){
							viewWidth = $this.attr(ShieldJS.css.WIDTH);
						}
						if($this.data("url")){ //有链接才处理
							var url = $this.data("url");
							if(hasAttr($this, "openUrl")){
								window.open($this.attr("openUrl"));
							}
							var params={};
							var checkParams = ShieldJS.HtmlAction.checkAnGetParamSelector($this, params); //参数选择器
							if (!checkParams) {
								return false;
							} else {
								params = checkParams;
							}
							params = getParams($this, params);
							setTimeout(function() {
								ShieldJS.openDialog(url, params, function(ele, dialog) {
									//提交的表单统一命名为saveForm
									var saveForm = ele.find('form.saveForm');
									
									saveForm.unbind('submit').submit(function() {
										if(saveForm.kvvalid()){ //表单验证
											if(hasAttr($this, "submitTips")){
												setTimeout(function() {
													ele.find('.contentBody').html($this.attr('submitTips'));//改变了form结构
												},10);
											}
											return true;
										}
										return false; //表单验证未通过
									});
									var shieldSubmitAction = ShieldJS.HtmlAction.HTMLEleActions["shieldSubmit"];
									if($.isFunction(shieldSubmitAction)){
										shieldSubmitAction(saveForm);
									}
									
									//ShieldJS.core.bindHtmlAction(ele, menuliSelect, navMenuSelect, searchForm, dialog); //内部继续加载
									// 自定义点击回调
									ShieldJS.HtmlAction.clickCallback($this);
								}, viewTitle, viewWidth);
							},10);
							return false;
						}
					});
				}
				,description : "弹出新窗口操作"
			 },
			 /** 图片上传 */
			 shieldImageUpload : {
				expression : 'input.shieldImageUpload',
				fn : function(selectE, menuliSelect, navMenuSelect, searchForm){
					// 待实现
				},
				checkFn : function(contentE, menuliSelect, navMenuSelect, searchForm){
					var dealEle = findAndMarkEle(contentE, this.expression);
					var eleName = "图片上传组件shieldImageUpload";
					return dealEle.length > 0 ? dealEle : false;
				}
				,description : "图片上传"
			},
			/** 删除图片 */
			shieldImgDelete : {
				expression : 'input.shieldImgDelete',
				fn : function(selectE, menuliSelect, navMenuSelect, searchForm){
					 // 待实现
				},
				checkFn : function(contentE, menuliSelect, navMenuSelect, searchForm){//检查函数
					var dealEle = findAndMarkEle(contentE, this.expression);
					var eleName = "图片删除组件shieldImgDelete";
					return dealEle.length > 0 ? dealEle : false;
				}
				,description : "删除图片"
			},
			/** 多图片上传插件 */
			shieldMultiImgUpload : {
				expression : '.shieldMultiImgUpload',
				fn : function(selectE, menuliSelect, navMenuSelect, searchForm) {
					// 待实现
				},
				checkFn : function(contentE, menuliSelect, navMenuSelect, searchForm) { //检查函数
					var dealEle = findAndMarkEle(contentE, this.expression);
					var eleName = "图片上传组件shieldMultiImgUpload";
					return dealEle.length > 0 ? dealEle : false;
				}
				,description : "多图片上传插件"
			},
			/** 下载附件 */
			shieldDownload : {
				expression : '.shieldDownload',
				fn : function(selectE) {
					// 待实现
				},
				checkFn : function(contentE) {
					var dealEle = findAndMarkEle(contentE, this.expression);
					var eleName = "下载附件元素shieldDownload";
					return dealEle.length > 0 ? dealEle : false;
				}
				,description : "下载附件"
			},
			/** 关联其他元素的select
			 * @example 
			 * //选择1时显示 id为dealBySpider的元素 选择2是显示id为yaunyinSpider的元素
			 * &lt;select id="state" name="state" class="shieldSelectRelated">
					&lt;option value="">--请选择--&lt;/option>
					&lt;option value="1" relatedTo="#dealBySpider">通过&lt;/option>
					&lt;option value="2" relatedTo="#yaunyinSpider">退回&lt;/option>
				&lt;/select>
			*/
			shieldSelectRelated : {
				expression : '.shieldSelectRelated',
				fn: function(selectE){
					var shieldSelectRelated = selectE;
					shieldSelectRelated.change(function(){
						var $this = $(this);
						setTimeout(function() {
							var selectVal = $this.val();
							
							var paramNames = {id:"id",name:"name"}; //默认参数配置
							if (hasAttr($this, "relatedTo")) { //select级别联动
								var relatedTo = $this.attr("relatedTo");
								var relatedToE = getjQueryObj(relatedTo);
								var relatedUrl = $this.attr("relatedUrl");
								
								var paramAdapter = $this.attr("paramAdapter");
								var paramAdapters = paramAdapter.split("#"); //#号分隔
								for (var i=0;i&lt;paramAdapters.length;i++) {
									var paramName = paramAdapters[i];
									if (paramName.indexOf("=")!=-1) {
										var paramNames = paramName.split("="); //如果key与提交不一致用=号分隔
										var paramsKey = paramNames[0];
										var jsonResutlKey = paramNames[1];
										paramNames[paramsKey] = jsonResutlKey;
									} else {
										paramNames[paramName] = paramName;
									}
								}
								//获取数据
								if(relatedUrl.indexOf("{}") != 0){
									relatedUrl = relatedUrl.replace("{}",selectVal);
								}
								var params={};
								var checkParams = ShieldJS.HtmlAction.checkAnGetParamSelector($this, params); //参数选择器
								if (!checkParams) {
									return false;
								} else {
									params = checkParams;
								}
								params = getParams($this, params);
								$.getJSON(relatedUrl, params, function(json) {
									var html = "";
									if (json) {
										for ( var i = 0; i &lt; json.length; i++) {
											html += '&lt;option value="' + json[i][paramNames.id] + '">';
											html += json[i][paramNames.name] + '&lt;/option>';
										}
									}
									relatedToE.find("option:not(.noshield)").remove();
									relatedToE.append(html);
								});
							}
							//option联动
							$this.find("option").each(function(){
								var $thisOption = $(this);
								var opetionVal = $thisOption.val();
								if (hasAttr($thisOption, "relatedTo")) { //有属性才处理
									var relatedTo = $thisOption.attr("relatedTo");
									var relatedToE = getjQueryObj(relatedTo);
									if (opetionVal === selectVal) {
										relatedToE.find(":input").prop("disabled",false);
										relatedToE.show();
									} else {
										//表单设为不可用
										relatedToE.find(":input").prop("disabled",true);
										relatedToE.hide();
									}
								}
							});
							
						}, 1); //加定时器是因为通过utils赋值的select不加取不到值
					});
					shieldSelectRelated.triggerHandler("change");//触发自定义change事件
				},
				checkFn : function(contentE) { //检查函数
					var dealEle = findAndMarkEle(contentE, this.expression);
					var eleName = "联动select元素shieldSelectRelated";
					if(dealEle.length > 0 ) {
						dealEle.each(function(){
							var $this = $(this);
							if (hasAttr($this,"relatedTo")) { //select级别的联动（区别于option级别）
								var relatedTo = $this.attr("relatedTo");
								var relatedToE = getjQueryObj(relatedTo);
								if (relatedToE.length == 0) {
									ShieldJS.error(eleName + "联动元素未找到：请检查relatedTo属性是否定义错误！");
									ShieldJS.console(eleName + "联动元素未找到：请检查relatedTo属性是否定义错误！"+$this.prop("outerHTML"));
									return false;
								}
								if (!hasAttr($this,"relatedUrl")) {
									ShieldJS.error(eleName + "未定义数据获取地址：relatedUrl属性");
									ShieldJS.console(eleName + "未定义数据获取地址：relatedUrl属性"+$this.prop("outerHTML"));
									return false;
								}
								if (!hasAttr($this,"paramAdapter")) {
									ShieldJS.error(eleName + "未定义参数适配：paramAdapter属性");
									ShieldJS.console(eleName + "未定义参数适配：paramAdapter属性"+$this.prop("outerHTML"));
									return false;
								}
							}
						});
					};
					return dealEle.length > 0 ? dealEle : false;
				}
				,description : "关联其他元素的select"
			},
			
			/** 关联其他元素的checkbox或radio
			 * @example 
			 * // shieldCheckedRelated关联操作checkbox或radio元素，relatedTo为关联到的元素，relatedToType="disabled"表示将目标元素更改disabled属性（其他值：disabledAndHide及不写）
			 * &lt;sapn style="float: left;padding: 3px;">&lt;input type="checkbox" id="acceptSetBtn" class="shieldCheckedRelated" relatedTo="#buySubmit" relatedToType="disabled">我已阅读并接受此规定&lt;/sapn>
			 * &lt;input type="button" id="buySubmit" class="shieldSubmit" value="购买" disabled="disabled">*/
			shieldCheckedRelated : {
				expression : '.shieldCheckedRelated',
				fn: function(selectE){
					
					selectE.each(function(){
						var thisSelectE = $(this);
						
						var shieldCheckedRelated = thisSelectE;
						var changeDealE; //如果是radio需处理为同一父类的radio
						if (shieldCheckedRelated.is(":radio")) { //单选框
							var formE = shieldCheckedRelated.closest("form");
							changeDealE = formE.find(":radio[name='"+shieldCheckedRelated.attr("name")+"']");
						}
						if (!changeDealE) {
							changeDealE = shieldCheckedRelated;
						}
						changeDealE.each(function() {
							var bindE = $(this);
							if (!bindE.hasClass("shieldCheckedRelatedInit")) {
								bindE.bind("change",function(){
									var $thisCheckedE = $(this);
									if (changeDealE) { //radio需处理同一父级的所有radio元素，否则点击其他的radio不会触发上一次选中radio的change事件
										$thisCheckedE = changeDealE;
									}
									$thisCheckedE.filter(":not(:checked)").each(function(){
										var $this = $(this);
										changeEvent($this);
									});
									$thisCheckedE.filter(":checked").each(function(){
										var $this = $(this);
										changeEvent($this);
									});
								});
								bindE.addClass("shieldCheckedRelatedInit");
                            }
                        });
						
						shieldCheckedRelated.triggerHandler("change");//触发自定义change事件
					});
					
					function showRelate2E(relatedToE, checked) {
						if (checked) {
							relatedToE.show();
                        } else {
                        	relatedToE.hide();
						}
                    }
					
					function changeEvent($this) {
						setTimeout(function() {
							var checked = $this.prop("checked");
							
							if (hasAttr($this, "relatedTo")) { //关联元素
								var relatedTo = $this.attr("relatedTo");
								var relatedToE = getjQueryObj(relatedTo);
								
								if (hasAttr($this, "relatedToType")) { //定义关联状态
									var relatedToType = $this.attr("relatedToType").toLowerCase(); //转小写
									if (relatedToType == "disabled") { //仅设为不可用
										relatedToE.prop("disabled",!checked);
									} else if (relatedToType == "disabledandhide") { //设为不可用并隐藏
										relatedToE.prop("disabled",!checked);
										relatedToE.find(":input").each(function() {
											var $thisInput = $(this);
											var disabled = $thisInput.prop("disabled");
											var data_enabled = $thisInput.data("enabled");
											var data_disabled = $thisInput.data("disabled");
											if (!data_enabled &amp;&amp; !data_disabled) { //未设置，则保存
												if (disabled) {
													data_disabled = true;
													$thisInput.data("disabled", true);
                                                } else {
                                                	$thisInput.data("enabled", true);
                                                }
											}
											if (checked) { //可用
												$thisInput.prop("disabled", data_disabled?true:false);
                                            } else { //不可用
                                            	$thisInput.prop("disabled",!checked);
                                            }
                                        });
										showRelate2E(relatedToE, checked);
									} else { //仅隐藏
										showRelate2E(relatedToE, checked);
									}
								} else { //仅隐藏
									showRelate2E(relatedToE, checked);
								}
								if (checked) {
									var datas = $this.data(); //用data存储
									for ( var key in datas) {
										relatedToE.find('[name="'+key+'"]').val(datas[key]);
									}
                                }
							}
						}, 1); //加定时器是防止utils干扰
                    }
					
					
				},
				checkFn : function(contentE) { //检查函数
					var dealEle = findAndMarkEle(contentE, this.expression);
					var eleName = "联动checkbox或radio元素shieldCheckedRelated";
					if(dealEle.length > 0 ) {
						dealEle.each(function(){
							var $this = $(this);
							if (hasAttr($this,"relatedTo")) {
								var relatedTo = $this.attr("relatedTo");
								var relatedToE = getjQueryObj(relatedTo);
								if (!relatedToE || relatedToE.length == 0) {
									ShieldJS.error(eleName + "联动元素未找到：请检查relatedTo属性是否定义错误！");
									ShieldJS.console(eleName + "联动元素未找到：请检查relatedTo属性是否定义错误！"+$this.prop("outerHTML"));
									return false;
								}
							}
						});
					};
					return dealEle.length > 0 ? dealEle : false;
				}
				,description : "关联其他元素的checkbox或radio"
			},
			/** 全选 */
			checkall : {
				expression : '#checkall',
				fn: function(contentE){
					findAndMarkEle(contentE, this.expression).change(function() {
						var $this = $(this);
						var checked = $this.is(':checked');
						var rangeE = $this.closest("table");
						if (hasAttr($this, "rangeEle")) {
							var rangeTo = $this.attr("rangeEle");
							rangeE = getjQueryObj(rangeTo);
							if (rangeE.length == 0) {
								ShieldJS.error("全选处理范围元素未找到：请检查rangeEle属性是否定义错误！");
								ShieldJS.console("全选处理范围元素未找到：请检查rangeEle属性是否定义错误！"+$this.prop("outerHTML"));
								return false;
							}
						}
						rangeE.find(':checkbox').each(function() {
							$(this).prop("checked", checked);
						});
					});
				}
				,description : "全选"
			},
			/** 用于标记选中行，一般用于checkbox上用于选中行传参 */
			shieldSelectRow : {
				expression : '.shieldSelectRow',
				fn: function(contentE){
					findAndMarkEle(contentE, this.expression).change(function() {
						var $this = $(this);
						var checked = $this.is(':checked');
						var checkClass = ShieldJS.HtmlAction.names.shieldSelectRowByshieldCheck;
						var rowEle = $this.closest("tr");
						rowEle.toggleClass(checkClass);
					});
				}
				,description : "用于标记选中行，一般用于checkbox上用于选中行传参"
			},
			/** 用于表单自动提交 */
			autoSubmitFormPlugin : {
				expression : '.autoSubmitForm_plugin',
				fn: function(contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog) {
					findAndMarkEle(contentE, this.expression).each(function(i, n) {
						var $this = $(this);
						var successDo = ShieldJS.HtmlAction.successDo.shieldRefresh; // 默认提交成功后的回调方法
						//ShieldJS.form.initSubmit($this, function(formE, targetE, data){
							//改写form的submit方法（util.js）
							ShieldJS.core.bindHtmlAction(contentE, menuliSelect, navMenuSelect, searchForm, shieldDialog); //内部继续加载,已经默认实现
							//ShieldJS.HtmlAction.formSubmitCallback(successDo, formE, targetE, data, menuliSelect, navMenuSelect, searchForm, shieldDialog);
						//});
						$this.submit();
						//页面处理
						
					});
				}
				,description : "自动提交表单"
			},
			/** 无数据tr处理 */
			noDataTrPlugin : {
				expression : '.nodatatr_plugin',
				fn: function(contentE) {
					findAndMarkEle(contentE, this.expression).each(function(i, n) {
						var $this = $(this);
						var pervTr = $this.prev();
						$this.find("th,td").attr("colspan", pervTr.find("th,td").length);
					});
				}
				,description : "无数据tr处理"
			},
			/** 用于显示所有已经注册的ShieldJS的html扩展动作方法 */
			showAllShieldJS : {
				expression : '.showAllShieldJS',
				fn: function(contentE){
					findAndMarkEle(contentE, this.expression).each(function(i, n) {
						var $this = $(this);
						var actions = $.extend({},ShieldJS.HtmlAction.HTMLEleActions);
						var tablecls = "allShieldJSHtmlActions "; //table的class
						tablecls += $this.data("class")||"";
						var extendUrl = $this.data("extendUrl"); //扩展url，查看示例
						var htmlStr = '&lt;table class="'+tablecls+'">'+
										 '&lt;tr class="headertr">&lt;th class="shieldjs_headertr_xh">&lt;/th>&lt;th class="shieldjs_headertr_method">方法名&lt;/th>&lt;th class="shieldjs_headertr_ex">表达式&lt;/th>&lt;th class="shieldjs_headertr_des">描述&lt;/th>';
						if (extendUrl) {
							htmlStr += '&lt;th class="shieldjs_headertr_demo">示例&lt;/th>';
                        }
						htmlStr += '&lt;/tr>';
						var index = 0;
						for(var actionName in actions){
							index++;
							htmlStr += '&lt;tr class="datatr">&lt;td class="shieldjs_datatr_xh">'+index+'&lt;/td>&lt;td class="shieldjs_datatr_method">'+actionName+'&lt;/td>&lt;td class="shieldjs_datatr_ex">'+(actions[actionName].expression||"")+'&lt;/td>&lt;td class="shieldjs_datatr_des">'+(actions[actionName].description||"")+'&lt;/td>';
							if (extendUrl) {
								htmlStr += '&lt;td class="shieldjs_datatr_demo">&lt;a data-url="'+$this.data("extendUrl")+actionName+'" class="shieldDialog" viewTitle="查看信息" viewWidth="800">查看示例&lt;/td>';
	                        }
							htmlStr += '&lt;/tr>';
						}
						htmlStr += '&lt;/table>';
						var tableE = $(htmlStr);
						tableE.find("td").each(function(i, n) {
							$(this).data("html", $(this).html());
						});
						if(extendUrl){
							ShieldJS.core.bindHtmlAction(["shieldDialogOrLookup"], tableE); //加载shieldDialogOrLookup方法
						}
						var _defaults = {
							/**前景色*/
							foreground: 'red',    
							/**背景色*/
						    background: 'yellow'    
						};
						//搜索
						$(".showAllShieldJSSearch").on("keyup", contentE, function() {
	                        var $search = $(this);
	                        var searchKey = $.trim($search.val());
	                        if (searchKey) {
	                        	var options = $.extend(true, _defaults, getSettings($search));
	                        	tableE.find("tr.datatr").hide();
	                        	tableE.find("tr.datatr").filter(function() {
	                        		if ($(this).text().toLowerCase().indexOf($search.val().toLowerCase())!=-1) {
	                        			var reg = new RegExp("("+$search.val()+")", "gi"); //全局并忽略大小写
	                        			$(this).find("td").not(".shieldjs_datatr_demo").each(function(i, n) { //排除示例
	                        				var newstr = $(n).data("html").replace(reg, '&lt;strong style="background-color: '+options.background+';color: '+options.foreground+';">$1&lt;/strong>');
	                        				$(n).html(newstr);
                                        });
	                        			return true;
	                        		}
	                        		return false; 
	                        	}).show();
                            } else {
                            	tableE.find("tr.datatr").show().find("td").not(".shieldjs_datatr_demo").each(function(i, n) {
        							$(this).html($(this).data("html"));
        						});
							}
                        });
						$this.append(tableE);
					});
				}
				,description : "展示所有的注册方法"
			}
		},
		
		/** 添加htmlEle动作处理函数
		 * @param HTMLEleName {String} 方法名称
		 * @param expression {String} 表单式
		 * @param fn {String} 处理函数
		 * @param checkFn {String} 检查函数【可无】
		 * @param description {String} 方法描述 */
		addHTMLEleAction : function (HTMLEleName, expression, fn, checkFn, description) {
			if(this.HTMLEleActions[HTMLEleName]){
				ShieldJS.debug(HTMLEleName + "动作处理方法被覆盖！");
			}
			// 复制对象
		    var copiedObject = $.extend({}, this.HTMLEleActions[HTMLEleName]);
		    var expressionV = arguments[1]; //重载，expression可能不存在
		    var indexRemove = 0;
		    if ($.isFunction(expression)) {
		    	expressionV = "";
		    	indexRemove++;
            }
		    var fnV = arguments[2-indexRemove]; //重载，checkFn函数可能不存在
		    var checkFnV = arguments[3-indexRemove];
		    var descriptionV = arguments[4-indexRemove];
		    if (typeof(checkFnV)=="string") {
		    	descriptionV = checkFnV;
            }
			this.HTMLEleActions[HTMLEleName] = {
				expression : expressionV || "" //表达式
				,fn:fnV //处理函数
				,checkFn:checkFnV //检查函数，是否缺少属性等，如果不合法返回false
				,description : descriptionV || copiedObject.description //方法描述
			};
		}
	}
})(jQuery);
</pre>
    </article>
</section>





		</div>
	</div>

	<div class="clearfix"></div>

	

</div>
</div>


    <div class="modal fade" id="searchResults">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title">Search results</h4>
          </div>
          <div class="modal-body"></div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
          </div>
        </div><!-- /.modal-content -->
      </div><!-- /.modal-dialog -->
    </div>


<footer>


	<span class="copyright">
	ShieldJS2 Copyright © 2018-2019 基于JSDoc3 and DocStrap生成的JsDoc说明文档.
	</span>

<span class="jsdoc-message">
	Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
	
		on Mon Dec 16th 2019
	
	using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
</footer>

<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>

    <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>


<script>
$( function () {
	$( "[id*='$']" ).each( function () {
		var $this = $( this );

		$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
	} );

	$( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
		var $this = $( this );

		var example = $this.find( "code" );
		exampleText = example.html();
		var lang = /{@lang (.*?)}/.exec( exampleText );
		if ( lang && lang[1] ) {
			exampleText = exampleText.replace( lang[0], "" );
			example.html( exampleText );
			lang = lang[1];
		} else {
			var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
			lang = langClassMatch ? langClassMatch[1] : "javascript";
		}

		if ( lang ) {

			$this
			.addClass( "sunlight-highlight-" + lang )
			.addClass( "linenums" )
			.html( example.html() );

		}
	} );

	Sunlight.highlightAll( {
		lineNumbers : true,
		showMenu : true,
		enableDoclinks : true
	} );

	$.catchAnchorLinks( {
        navbarOffset: 10
	} );
	$( "#toc" ).toc( {
		anchorName  : function ( i, heading, prefix ) {
			return $( heading ).attr( "id" ) || ( prefix + i );
		},
		selectors   : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
		showAndHide : false,
		smoothScrolling: true
	} );

	$( "#main span[id^='toc']" ).addClass( "toc-shim" );
	$( '.dropdown-toggle' ).dropdown();

    $( "table" ).each( function () {
      var $this = $( this );
      $this.addClass('table');
    } );

} );
</script>



<!--Navigation and Symbol Display-->


<!--Google Analytics-->



    <script type="text/javascript">
        $(document).ready(function() {
            SearcherDisplay.init();
        });
    </script>


</body>
</html>
